'complexity': "normal",
'description': """
-Module pour les personnalisations de L'Heureux Cyclage
-======================================================
+Custom module for L'Heureux Cyclage
+===================================
+- Customing for professionnal training activities;
+- Event management optimization;
+- Add some partners fields;
+- …
""",
'author': 'L\'Heureux Cyclage',
'website': 'http://www.heureux-cyclage.org',
),
}
+ def onchange_contact_id(self, cr, uid, ids, contact, partner, context=None):
+ """Concat phone with mobile phone if exist. If mobile exist and not
+ phone, add mobile number"""
+ vals = super(event_registration, self).onchange_contact_id(cr, uid, ids, contact, partner, context)
+ addr_obj = self.pool.get('res.partner')
+ contact_id = addr_obj.browse(cr, uid, contact, context=context)
+ phone = vals['value']['phone']
+ mobile = contact_id.mobile
+ import pdb
+ pdb.set_trace()
+ if mobile:
+ if phone:
+ vals['value']['phone'] = '%s - %s' % (phone, mobile)
+ else:
+ vals['value']['phone'] = mobile
+ return vals
+
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: